package com.abysscore.yachtdesign;
import java.awt.Color;

public class TFreeSpline extends TFreeEntity {
	private int FCapacity;                                                           // Number of points for which memory has been allocated
	private int FNoPoints;                                                           // Actual number of points present
	private int FFragments;                                                           // Number of straight-line segments used when drawing the curve
	private boolean FShowCurvature;
	private boolean FShowPoints;
	private double FCurvatureScale;                                                        // scale factor used to increase or decrease the scale of the curvature plot
	private Color FCurvatureColor;                                                            // Color used for draing the curvature plot
	private double FTotalLength;
	private TFreeCoordinateArray FPoints;                                              // Array containing all controlpoints
	private boolean[] FKnuckles;
	private double[] FParameters;
	private TFreeCoordinateArray FDerivatives;
	
	
	private int FGetFragments()
	{
		return FFragments;
	}
	private boolean FGetKnuckle(int Index)
	{
		return FKnuckles[Index];
	}
	private double FGetParameter(int Index)
	{
		return FParameters[Index];
	}
	private T3DCoordinate FGetPoint(int Index)
	{
		return FPoints.get(Index);
	}
	private void FSetBuild(boolean val)
	{
		FBuild = val;//                                       override;
	}
	private void FSetCapacity(int Val)
	{
		FCapacity = Val;
	}
	private void FSetFragments(int Val)
	{
		FFragments = Val;
	}
	private void FSetKnuckle(int Index,boolean Value)
	{
		FKnuckles[Index] = Value;
	}
	private void FSetPoint(int Index, T3DCoordinate P)
	{
		//TODO
	}

	public void Add(T3DCoordinate P)
	{
		//TODO;                                       // add a new point to the curve
	}
	public void Assign(TFreeSpline Spline)
	{
		;                                 // Copy all data from another spline
	}
	public double CoordLength(double T1,double T2)
	{
		return 0.0;
	}
	public double ChordlengthApproximation(double Percentage)
	{
		return 0.0;
	}
	public void Clear()
	{
		//override;
	}
	public TFreeSpline()
	{
		; //                                                    override;
	}
	public double Curvature(double Parameter, T3DCoordinate Value, T3DCoordinate Normal)
	{
		return 0.0;
	}
	public void DeletePoint(int Index)
	{
		;
	}
	public int DistanceToCursor(int X, int Y, TFreeViewport Viewport)
	{
		return 0;//virtual;
	}
	public void Draw(TFreeViewport Viewport)
	{
		;//                               override;
	}
	public T3DCoordinate FirstDerive(double Parameter)
	{
		return null;
	}
	public void Insert(int Index, T3DCoordinate P)
	{
		;
	}
	public void InsertSpline(int Index, boolean Invert,boolean DuplicatePoint, TFreeSpline Source)
	{
		;
	}
	public boolean IntersectPlane(T3DPlane Plane, TFreeIntersectionData Output)
	{
		return false;
	}
	public void InvertDirection()
	{
		;                                            // invert the direction of the controlpoints and knuckles
	}
	public void LoadBinary(TFreeFileBuffer Source)
	{
		int I=0;
		int N=0;
		T3DCoordinate P=null;
	    boolean K = false;

	    Source.Load(FShowCurvature);
	    Source.Load(FCurvatureScale);
	    Source.Load(N);
	    Capacity(N);
	    for (I=1; I<=N; I++)
	    {
	    	Source.Load(P);
	    	Add(P);
	    	Source.Load(K);
	    	Knuckle(I-1,K);
	    }
	}
	public void Rebuild()
	{
		; //                                                   override;
	}
	public void SaveBinary(TFreeFileBuffer Destination)
	{
		;//                    virtual;
	}
	public void SaveToDXF(TStringList Strings, String Layername, boolean SendMirror)
	{
		;
	}
	public T3DCoordinate SecondDerive(double Parameter)
	{
		return null;
	}
	public boolean Simplify(double Criterium)
	{
		return false;                     // Remove points that do not contribute significantly to the shape
	}
	public T3DCoordinate Value(double Parameter)
	{
		return null;
	}

	
	public int Capacity() { return FCapacity; }
	public void Capacity(int val) { FSetCapacity(val); }
	public Color CurvatureColor() { return FCurvatureColor; }
	public void CurvatureColor(Color val) { FCurvatureColor = val; }
	public double CurvatureScale() { return FCurvatureScale; }
	public void CurvatureScale(double val) { FCurvatureScale = val; }
	public int Fragments() { return FGetFragments(); } 
	public void Fragments(int val) { FSetFragments(val); }
	public boolean Knuckle(int Index) { return FGetKnuckle(Index); }
	public void Knuckle(int Index, boolean val) { FSetKnuckle(Index, val); }
	public int NumberOfPoints() { return FNoPoints; }
	public double Parameter(int Index) { return FGetParameter(Index); }
	public T3DCoordinate Point(int Index) { return FGetPoint(Index); }
	public void Point(int Index, T3DCoordinate val) { FSetPoint(Index, val); }
	public boolean ShowCurvature() { return FShowCurvature; }
	public void ShowCurvature(boolean val) { FShowCurvature = val; }
	public boolean ShowPoints() { return FShowPoints; }
	public void ShowPoints(boolean val) { FShowPoints = val; } 
	public double TotalLength(){ return FTotalLength; }
}
